<?
$this->Html->css('/js/libs/redactor/css/redactor.css', null, array('inline' => false));
$this->Html->script('libs/redactor/redactor.min', array('inline' => false, 'block' => 'scriptBottom'));
$this->Html->scriptBlock('$(document).ready(function(){$(\'#EventDesc\').redactor({ autoresize: true, cleanUp: true, convertDivs: false, removeClasses: false, imageUpload: \'/admin/images/upload\', imageGetJson: \'/admin/images/uploads.json\'});});', array('inline' => false, 'block' => 'scriptBottom'));
?>
<div class="events form">
    <?php echo $this->Form->create('Event'); ?>
    <fieldset>
        <legend><?php echo __('Admin Edit Event'); ?></legend>
        <?php
        echo $this->Form->input('id');
        echo $this->Form->input('name', array('placeholder' => 'Event name'));
        echo $this->Form->input('startdate');
        echo $this->Form->input('desc');
        echo $this->Form->input('limit', array('placeholder' => 'Attendee limit'));
        echo $this->Form->input('accepting', array('label' => 'Accepting registrations', 'default' => true));
        echo $this->Form->input('active', array('default' => true));
        echo $this->Form->input('place_id');
        echo $this->Form->input('chapter_id');
        echo $this->Form->input('user_id', array('type' => 'hidden', 'value', AuthComponent::user('id')));
        echo $this->Form->input('slug', array('placeholder' => 'Leave empty for auto'));
        echo $this->Form->input('form', array('label'=>'Spreadsheet ID (to prompt to user when register)','placeholder'=>'Enter additional spreadsheet id'));
        ?>
    </fieldset>
    <?php echo $this->Form->end(__('Submit')); ?>
</div>
<div class="actions">
    <h3><?php echo __('Actions'); ?></h3>
    <ul>

        <li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Event.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Event.id'))); ?></li>
        <li><?php echo $this->Html->link(__('List Events'), array('action' => 'index')); ?></li>
        <li><?php echo $this->Html->link(__('List Chapters'), array('controller' => 'chapters', 'action' => 'index')); ?> </li>
        <li><?php echo $this->Html->link(__('New Chapter'), array('controller' => 'chapters', 'action' => 'add')); ?> </li>
        <li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
        <li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
    </ul>
</div>
